function! bootstrap#background#setup() abort
    if !exists(':ToggleBackground')
        command! ToggleBackground call bootstrap#background#toggle()
        nmap <Plug>(toggle-background) :ToggleBackground<cr>
    endif
    call SpaceVim#custom#SPC('nore', ['T', 'b'], 'ToggleBackground', 'toggle background', 1) 
endfunction

function! bootstrap#background#toggle() abort
    let l:background = &background
    " call bootstrap#message("before toggle: &background = " . &background)
    if !empty(matchstr(l:background, 'light'))
        " call bootstrap#message("&background matched with light")
        set background=dark
    endif
    if !empty(matchstr(l:background, 'dark'))
        " call bootstrap#message("&background matched with dark")
        set background=light
    endif
    " call bootstrap#message("after toggle: &background = " . &background)
endfunction
